package com.bojx.report.dao;

import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.activerecord.SqlPara;

public class VerifyDao {
	public Record queryQtyAndAmt(String bank,String area,String billType,String actionType,int year,int month){
		Kv cond=Kv.by("year", year).set("month", month).set("organization", bank).set("area",area).set("billType",billType).set("actionType",actionType);
	    SqlPara sqlPara=Db.getSqlPara("verify.queryQtyAndAmt",cond);
	    return Db.findFirst(sqlPara);
	}
	
	public Record queryRecord(String bank,int year,int month){
		Kv con=Kv.by("year", year).set("month",month).set("bank",bank);
		SqlPara sqlPara=Db.getSqlPara("verify.queryRecord", con);
		return Db.findFirst(sqlPara);
	}
	
	public Record queryLastMonthBranchRecord(String bank,int year,int month,String area){
		Kv con=Kv.by("year", year).set("month",month).set("bank",bank).set("area", area);
		SqlPara sqlPara=Db.getSqlPara("verify.queryLastMonthBranchRecord", con);
		return Db.findFirst(sqlPara);
	}
}
